

from aiohttp import web

async def handle(request):
    return web.Response(body=b'<h1>index</h1>', content_type="text/html")

async def handleab(request):
    return web.Response(body=b'<h1>ab</h1>', content_type="text/html")

app = web.Application()
# 路由器 指定了/路径由哪个方法处理
app.router.add_get('/', handle)
app.router.add_get('/ab', handleab)

print("======== Running on http://127.0.0.1:8080 ========")
web.run_app(app)
